import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  
  {
    path: '/index',
    name: 'index',
    redirect:'/Welcome',
    meta: {
      auth: true
    },
    component: () => import('../views/main/index.vue'),
    children: [{
      path: '/welcome',
      name: 'welcome',
      component: () =>
        import('../views/Welcome/Welcome.vue')
    },
    {
      path: '/users',
      name: 'users',
      component: () =>
        import('../views/Users.vue')
    },
    {
      path: '/rights',
      name: 'rights',
      component: () =>
        import('../views/Rights/Rights.vue')
    },
    {
      path: '/roles',
      name: 'roles',
      component: () =>
        import('../views/Rights/Roles.vue')
    },
    {
      path: '/goods',
      name: 'goods',
      component: () =>
        import('../views/Goods/Goods.vue')
    },
    {
      path: '/params',
      name: 'params',
      component: () =>
        import('../views/Params/Params.vue')
    },
    
    {
      path: '/categories',
      name: 'categories',
      component: () =>
        import('../views/Categories/Categories.vue')
    },
    {
      path: '/addproduct',
      name: 'addproduct',
      component: () =>
        import('../views/Addproduct/Addproduct.vue')
    },
    {
      path: '/orders',
      name: 'orders',
      component: () =>
        import('../views/orders')
    },
    {
      path: '/reports',
      name: 'reports',
      component: () =>
        import('../views/reports')
    }
  ]
  }
]

const router = new VueRouter({
  routes
})

export default router
